Skip to content

Add sign-public-ecr-image job to release workflow#1362

Merged
wangzlei merged 1 commit intoaws-observability:mainfrom
wangzlei:main
Apr 17, 2026
Merged

Add sign-public-ecr-image job to release workflow#1362
wangzlei merged 1 commit intoaws-observability:mainfrom
wangzlei:main

Conversation

@wangzlei
Copy link
Copy Markdown
Contributor

Summary

Backports the sign-public-ecr-image job from aws-otel-python-instrumentation release/v0.14.x to the Java instrumentation release workflow.

Changes

Added sign-public-ecr-image job in .github/workflows/release-build.yml that:

  1. Configures AWS credentials using AWS_ASSUME_ROLE_ARN_RELEASE
  2. Installs notation CLI with AWS Signer plugin
  3. Queries ADOTECRSigningProfile signing profile ARN (gracefully skips if not found)
  4. Logs in to public ECR and signs the released image PUBLIC_REPOSITORY:v$VERSION

The job runs after publish-sdk which pushes the multi-arch image to public ECR.

@wangzlei wangzlei requested a review from a team as a code owner April 17, 2026 16:44
@wangzlei wangzlei added the skip changelog doesn't need a CHANGELOG entry label Apr 17, 2026
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.39%. Comparing base (09e6487) to head (b9d3c8f).
⚠️ Report is 564 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #1362       +/-   ##
=============================================
- Coverage     85.71%   69.39%   -16.33%     
- Complexity       19      704      +685     
=============================================
  Files             3       63       +60     
  Lines            49     3437     +3388     
  Branches          5      487      +482     
=============================================
+ Hits             42     2385     +2343     
- Misses            3      861      +858     
- Partials          4      191      +187     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wangzlei wangzlei merged commit 901acee into aws-observability:main Apr 17, 2026
10 of 15 checks passed
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

I reviewed the sign-public-ecr-image job added to the release workflow. Overall the approach is sound and consistent with the existing signing pattern in publish-layer-prod. I found 2 issues worth addressing (1 security, 1 bug) and 1 suggestion. See inline comments below.

# Install notation CLI with AWS Signer plugin
- name: Install notation CLI with AWS Signer plugin
run: |
curl -Lo aws-signer-notation-cli_amd64.deb https://d2hvyiie56hcat.cloudfront.net/linux/amd64/installer/deb/latest/aws-signer-notation-cli_amd64.deb
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security: Binary downloaded without integrity verification

The notation CLI .deb package is downloaded from a CloudFront URL using the mutable latest tag, with no checksum or signature verification before installing via dpkg. If the CDN or distribution endpoint is compromised, a malicious binary would be silently installed and then used to sign your release images.

Consider pinning to a specific version and verifying its SHA256 checksum, e.g.:

run: |
  NOTATION_VERSION="1.3.0"  # pin to a known version
  NOTATION_SHA256="<expected-sha256>"
  curl -Lo aws-signer-notation-cli_amd64.deb \
    "https://d2hvyiie56hcat.cloudfront.net/linux/amd64/installer/deb/${NOTATION_VERSION}/aws-signer-notation-cli_amd64.deb"
  echo "${NOTATION_SHA256}  aws-signer-notation-cli_amd64.deb" | sha256sum -c -
  sudo dpkg -i aws-signer-notation-cli_amd64.deb

This is the same supply-chain hardening principle behind pinning GitHub Actions to commit SHAs (which this workflow already does correctly).

- name: Query ECR Signing Profile ARN
id: ecr-signing-profile
run: |
PROFILE_ARN=$(aws signer list-signing-profiles --region ${{ env.AWS_PUBLIC_ECR_REGION }} --query "profiles[?profileName=='ADOTECRSigningProfile'].arn" --output text 2>/dev/null)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: stderr suppression masks real AWS CLI errors. Redirecting stderr to /dev/null on the aws signer list-signing-profiles call (2>/dev/null) means that real failures like authentication errors, network timeouts, permission denied, and throttling are silently suppressed and treated identically to profile-not-found. The job would succeed without signing even when the profile exists but credentials are misconfigured. Consider removing 2>/dev/null and checking the exit code explicitly. If the AWS CLI call fails, the step should fail rather than silently skip. You could also use workflow warning annotations when the profile genuinely does not exist, so operators have visibility into skipped signing during releases. Note: the same 2>/dev/null pattern exists in the publish-layer-prod job (line 305) but is less critical there since that step uses continue-on-error: true.

echo "profile_arn=$PROFILE_ARN" >> $GITHUB_OUTPUT
echo "Found ECR signing profile: $PROFILE_ARN"
else
echo "ECR signing profile 'ADOTECRSigningProfile' not found"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Silent success when signing profile is missing may be too permissive for a release workflow. When the profile is not found, this exits 0 and subsequent steps are skipped via conditionals - the entire job reports success without any image being signed. For a release pipeline, consider making this a hard failure (exit 1) or at minimum emitting a GitHub Actions warning annotation so that release operators are aware signing was skipped. A release that ships unsigned images when signing was intended could be a compliance gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants